package com.hmall.order.web;

import com.hmall.order.pojo.RequestParams;
import com.hmall.order.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/order")
public class OrderController {

    @Autowired
    private OrderService orderService;

    // 创建订单业务
    @PostMapping
    public Long createOrder(@RequestBody RequestParams params){
        return orderService.createOrder(params);
    }
}
